package com.joey.cloud.flowable.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.joey.cloud.communal.constant.BaseConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.flowable.task.api.Task;

import java.io.Serializable;
import java.util.Date;

@ApiModel(value="代办任务信息")
@Data
public class TaskVo implements Serializable {
    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "任务id")
    private String taskId;
    @ApiModelProperty(value = "任务环节key")
    private String taskKey;
    @ApiModelProperty(value = "任务环节名称")
    private String taskName;
    @ApiModelProperty(value = "任务指派人id")
    private String assignee;
    @ApiModelProperty(value = "任务指派人名称")
    private String assigneeName;
    @ApiModelProperty(value = "任务创建时间")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = BaseConstant.entity_date_format)
    private Date createTime;
    @ApiModelProperty(value = "活动节点id")
    private String executionId;
    @ApiModelProperty(value = "业务key")
    private String businessKey;
    @ApiModelProperty(value = "流程实例id")
    private String processInstanceId;
    @ApiModelProperty(value = "流程key")
    private String processInstanceKey;
    @ApiModelProperty(value = "流程名称")
    private String processInstanceName;
    @ApiModelProperty(value = "流程描述")
    private String processInstanceDesc;
    @ApiModelProperty(value = "流程定义id")
    private String processDefinitionId;
    @ApiModelProperty(value = "部署id")
    private String deploymentId;
    @ApiModelProperty(value = "流程创建时间")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = BaseConstant.entity_date_format)
    private Date processStartTime;
    @ApiModelProperty(value = "流程创建人id")
    private String processStartUserId;
    @ApiModelProperty(value = "流程创建人名称")
    private String processStartUserName;



    public TaskVo(){}

    public TaskVo(Task task){
        this.taskId = task.getId();
        this.processDefinitionId = task.getProcessDefinitionId();
        this.processInstanceId = task.getProcessInstanceId();
        this.executionId = task.getExecutionId();
        this.taskKey =task.getTaskDefinitionKey();
        this.taskName = task.getName();
        this.createTime = task.getCreateTime();
        this.assignee = task.getAssignee();
    }

}
